home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Windows 95 API Bible
/
Windows 95 API Bible 3 Disc Set.iso
/
Win32 API Bible Book 1 of 3
/
CHAPTE22
/
EX2.C
< prev
next >
Wrap
C/C++ Source or Header
|
1995-05-27
|
2KB
|
47 lines
#include <genstub.c>
LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{
case WM_COMMAND:
switch ( LOWORD( wParam ) )
{
case IDM_TEST:
{
TCHAR szBuffer[64];
TCHAR szTemp[64];
HDC hDC = GetDC( hWnd );
static TCHAR szStart [25] = "Special characters here:";
static TCHAR szFrench[] = { 0x41, 0xee, 0x6e, 0xe9, 0 };
lstrcpy( szTemp, szStart );
lstrcat( szTemp, szFrench ); // concatenate special chars.
TextOut( hDC, 0, 0, szBuffer, wsprintf( szBuffer,
"Original String: %s", szTemp ) );
CharUpperBuff( szTemp, lstrlen( szTemp ) );
TextOut( hDC, 0, 20, szBuffer, wsprintf( szBuffer,
"After CharUpper: %s", szTemp) );
CharLowerBuff( szTemp + 5, 10 ); // lower chars 6-15
TextOut( hDC, 0, 40, szBuffer, wsprintf( szBuffer,
"After CharLower: %s", szTemp ) );
strlwr( szTemp ); // THIS IS AN ERROR!
TextOut( hDC, 0, 60, szBuffer, wsprintf( szBuffer,
"After strlwr: %s", szTemp));
ReleaseDC( hWnd, hDC );
}
break;
case IDM_EXIT:
DestroyWindow( hWnd );
break;
}
break;
case WM_DESTROY:
PostQuitMessage( 0 );
break;
default:
return (DefWindowProc(hWnd, uMsg, wParam, lParam));
}
return (NULL);
}